package com.ruijixiang.leetcode.weekly.leetcode2024.leetcode20241103;

public class Leetcode3340 {
    public boolean isBalanced(String num){
        int odd=0,even=0;
        int n=num.length();
        for(int i=0;i<n;i++){
            if((i & 1)==0){
                odd+=num.charAt(i)-'0';
            }else{
                even+=num.charAt(i)-'0';
            }
        }
        return odd==even;
    }
}
